<!--
 *代码由框架生成,任何更改都可能导致被代码生成器覆盖
 *业务请在@/extension/business/checklist/CheckListDetailed.js此处编写
 -->
<template>
    <view-grid ref="grid"
               :columns="columns"
               :detail="detail"
               :editFormFields="editFormFields"
               :editFormOptions="editFormOptions"
               :searchFormFields="searchFormFields"
               :searchFormOptions="searchFormOptions"
               :table="table"
               :extend="extend">
    </view-grid>
</template>
<script>
    import extend from "@/extension/business/checklist/CheckListDetailed.js";
    import { ref, defineComponent } from "vue";
    export default defineComponent({
        setup() {
            const table = ref({
                key: 'Id',
                footer: "Foots",
                cnName: '检化验明细',
                name: 'checklist/CheckListDetailed',
                url: "/CheckListDetailed/",
                sortName: "CheckListId",
                foreignKey:null
            });
            const editFormFields = ref({"Element":"","ElementId":"","Result":"","Standard":"","IsQualified":""});
            const editFormOptions = ref([[{"dataKey":"Element_List","data":[],"title":"元素","field":"Element","type":"select"},
                               {"title":"元素Id","field":"ElementId","disabled":true},
                               {"title":"结果","field":"Result"}],
                              [{"title":"标准","field":"Standard"},
                               {"title":"是否合格","field":"IsQualified","type":"switch"}]]);
            const searchFormFields = ref({"Element":"","Result":"","Standard":"","IsQualified":""});
            const searchFormOptions = ref([[{"dataKey":"Element_List","data":[],"title":"元素","field":"Element"},{"title":"结果","field":"Result"},{"title":"标准","field":"Standard"}],[{"title":"是否合格","field":"IsQualified","type":"number"}]]);
            const columns = ref([{field:'Id',title:'主键',type:'string',width:110,hidden:true,readonly:true,require:true,align:'left'},
                       {field:'CheckListId',title:'化验单主健',type:'string',width:110,hidden:true,align:'left'},
                       {field:'Element',title:'元素',type:'string',bind:{ key:'Element_List',data:[]},width:110,align:'left',sort:true},
                       {field:'ElementId',title:'元素Id',type:'string',width:110,hidden:true,readonly:true,align:'left'},
                       {field:'Result',title:'结果',type:'string',width:110,align:'left'},
                       {field:'Standard',title:'标准',type:'string',width:110,align:'left'},
                       {field:'IsQualified',title:'是否合格',type:'int',width:110,align:'left'}]);
            const detail = ref({
                cnName: "#detailCnName",
                table: "#detailTable",
                columns: [],
                sortName: "",
                key: ""
            });
            return {
                table,
                extend,
                editFormFields,
                editFormOptions,
                searchFormFields,
                searchFormOptions,
                columns,
                detail,
            };
        },
    });
</script>
